A storage system uses a cache to respond to a host request faster. After receiving a write request from a host, the storage system writes the host data into the cache and returns a response indicating completion of the host request. Then, the storage system may write the data in the cache into a magnetic disk at proper time. Although the cache enables the storage system to respond to the host request faster, the data in the cache may be lost in case of power failure of the storage system. Thus, the storage system with a cache supports data protection in case of power failure. In the conventional art, upon power failure of the storage system, the cache is powered on by a spare battery, so that the cache is refreshed constantly, which ensures that the data in the cache is not lost. As shown in FIG. 1, in case of power failure, the storage system cuts off all the services, and supplies power to the cache through the spare battery.
During the implementation of the invention, the inventor finds that the conventional art has at least the following weaknesses:
In case of long-term power failure, the cache in the storage system cannot be refreshed continuously due to the limited battery capacity, thus losing the data in the cache.